home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / com_and3.zip / TELENET.CMD < prev    next >
OS/2 REXX Batch file  |  1990-04-12  |  3KB  |  77 lines

  1. ; ----- Dial TELENET and connect
  2. ;    R.McG; 7/89, Chicago
  3. ; ----------------------------------------------------------------
  4. ; Usages:
  5. ;      S0 ------> Destroyed
  6. ;
  7. ; Requires:
  8. ;      This script does not FCALL any other script
  9. ;
  10. ; This script may be FCALLED
  11. ; ----------------------------------------------------------------
  12. ;    Make connection to TELENET.  The dialing directory (or current
  13. ;    .. setting define parity and speed).
  14. ;
  15.     LEGEND " Dialing Telenet... "
  16.     DEFTIME "60"            ; Wait 60 seconds for an incoming string
  17.     IF NOT LINKED        ; If script not invoked from Alt-D
  18.        DIAL "10"            ; Call dial dir entry number 10 (Telenet)
  19.        IF FAILED        ; IF esc out
  20.           EXIT        ; terminate script
  21.           ENDIF        ; End if failed
  22.        ENDIF        ; End if not linked
  23. ;
  24. ;    Make connection according to the dialing directory's parity/speed
  25. ;    .. i.e: parity and speed make a difference in how we connect
  26. ;
  27.     COMPARMS S0            ; Get current settings
  28.     IF STRCMP "N" S0(5:5)           ; If no parity
  29.        IF STRCMP "2400" S0(0:3)     ; If 2400 baud connect Send @D<cr>
  30.           PAUSE 5            ;    Wait for the modem to settle
  31.           TRANS "@"                 ;    Send @D<cr> slowly
  32.           PAUSE 1            ;    Wait a moment
  33.           TRANS "D"                 ;    Set to 8N1
  34.           PAUSE 1            ;    Wait a moment
  35.           TRANS "!"                 ;    Set to 8N1
  36.        ELSE             ; ELSE 300/1200 (send <cr>D<cr>)
  37.           PAUSE 5            ;    Wait for the modem to settle down
  38.           TRANSMIT "!D"             ;    Transmit Carriage return <CR> D
  39.           PAUSE 1            ;    Wait 1 sec
  40.           TRANSMIT "!"              ;    .. (8 bit identifier)
  41.           ENDIF
  42.     ELSE                ; ELSE even or odd parity
  43.        IF STRCMP "2400" S0(0:3)     ; If 2400 baud connect Send @D<cr>
  44.           PAUSE 5            ;    Wait for the modem to settle
  45.           TRANS "@"                 ;    Send @D<cr> slowly
  46.           PAUSE 1            ;    Wait a moment
  47.           TRANS "D"                 ;    Set to 8N1
  48.           PAUSE 1            ;    Wait a moment
  49.           TRANS "!"                 ;    Set to 8N1
  50.        ELSE             ; ELSE 300/1200 (send <cr><cr>)
  51.           PAUSE 5            ;    Wait for the modem to settle down
  52.           TRANSMIT "!"              ;    Transmit Carriage return <CR>
  53.           PAUSE 2            ;    Wait 1 sec
  54.           TRANSMIT "!"              ;    Transmit Carriage return <CR>
  55.           ENDIF
  56.        ENDIF
  57. ;
  58. ;    Send terminal identification
  59. ;
  60.     WAITFOR "TERMINAL="     ; Wait for the prompt
  61.     TRANSMIT "D1!"          ; Set terminal type
  62.     WAITFOR "@"             ; Wait for next prompt
  63.     SET BSUPPRESS OFF    ; Turn off blank line suppression
  64.     SET MASK ON        ; Turn on high bit mask
  65.     SET CDISPLAY ON     ; Display ctl chars
  66. ;
  67. ;    Exit - this script may be called
  68. ;
  69.     IF FCALLED
  70.        FRETURN
  71.        ENDIF
  72. ;
  73. ;    If we exit here, sound alarm
  74. ;
  75.     ALARM            ; Sound alarm - we're done
  76.     EXIT
  77.